#!/bin/bash
#监控从redis的状态，正常显示1，否则显示0

ip=192.168.152.12
port=6381
st=$(redis-cli -h $ip -p $port info replication | grep "master_link_status:" | awk -F: '{print $2}')

echo $st
if [ "$st" == "up " ];then
	echo "1"
  else
	echo "0"
fi
